﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="QuanLyTheLoai.ascx.cs" Inherits="Main.Administrator.QuanLyTheLoai" %>
<script type="text/javascript">
    function Check(id)
    {
        if(document.getElementById(id).value == '')
        {
            alert('Chưa nhập tên thể loại.');
            return false;
        }
        return true;
    }
</script>
<div id="Location" class="Location" runat="server"><a href="../Administrator.aspx">Administrator Page</a> >> Quản lý Thể Loại</div>
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
 <ContentTemplate>
 <div id="Notice" class="Notice" runat="server" visible="false"></div>
<div id="Errors" class="Errors" runat="server" visible="false"></div>
<div id="Form">
     <asp:GridView DataKeyNames="MaTheLoai" ID="GridView1" runat="server" SkinID="GridViewSkin"
        AutoGenerateColumns="False"  AllowPaging="True" AllowSorting="true" ShowFooter="True" 
        OnPageIndexChanging="GridView1_PageIndexChanging" OnRowDeleting="GridView1_RowDeleting" 
        OnRowCancelingEdit="GridView1_RowCancelingEdit" OnRowEditing="GridView1_RowEditing" 
        OnRowUpdating="GridView1_RowUpdating" OnRowCommand="GridView1_RowCommand" OnRowDataBound="GridView1_RowDataBound" OnSorting="GridView1_Sorting">
        <Columns>
            <asp:TemplateField HeaderText="Mã Thể Loại" SortExpression="MaTheLoai">
                <ItemTemplate>
                    <asp:Label id="lblMaTheLoai" runat="server" Text='<%# Eval ( "MaTheLoai" ) %>'></asp:Label>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:Label id="lblMaTheLoai_e" runat="server" Text='<%# Eval ( "MaTheLoai" ) %>'></asp:Label>
                </EditItemTemplate>
                <FooterTemplate>
                    [Tự Phát Sinh]
                </FooterTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="T&#234;n Thể Loại" SortExpression="TenTheLoai">
                <ItemTemplate>
                    <asp:Label id="lblTenTheLoai" runat="server" Text='<%# Eval ( "TenTheLoai" ) %>'></asp:Label>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="txtTenTheLoai" runat="server" Text='<%# Eval ( "TenTheLoai" ) %>'></asp:TextBox>
                </EditItemTemplate>
                <FooterTemplate>
                    <asp:TextBox ID="txtTenTheLoai_New" runat="server"></asp:TextBox>
                </FooterTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="M&#244; Tả">
                <ItemTemplate>
                    <asp:Label id="lblMoTa" runat="server" Text='<%# Eval ( "MoTa" ) %>'>
                   </asp:Label>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="txtMoTa" runat="server" Text='<%# Eval ( "MoTa" ) %>'></asp:TextBox>
                </EditItemTemplate>
                 <FooterTemplate>
                    <asp:TextBox ID="txtMoTa_New" runat="server"></asp:TextBox>
                </FooterTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Thao T&#225;c">
                <ItemTemplate>
                    <asp:LinkButton ID="lnkEdit" CommandName="Edit" runat="server" ToolTip="Sửa">
                        <asp:Image ID="imgEdit" runat="server" SkinID="Edit" />
                    </asp:LinkButton>
                    <asp:LinkButton ID="lnkDelete" CommandName="Delete" runat="server" ToolTip="Xóa" OnClientClick="ShowConfirm(this,Message1); return false;">
                        <asp:Image ID="imgDelete" runat="server" SkinID="Delete" />
                    </asp:LinkButton>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:LinkButton ID="lnkSave" runat="server" CommandName="Update" ToolTip="Save">
                        <asp:Image ID="imgSave" runat="server" SkinID="Save" />
                    </asp:LinkButton>
                    <asp:LinkButton ID="lnkCancel" runat="server" CommandName="Cancel" ToolTip="Cancel">
                        <asp:Image ID="imgCancel" runat="server" SkinID="Cancel" />
                    </asp:LinkButton>
                </EditItemTemplate>
                <FooterTemplate>
                    <asp:LinkButton ID="lnkInsert" runat="server" CommandName="Insert" ToolTip="Insert">
                        <asp:Image ID="imgInsert" runat="server" SkinID="Insert" />
                    </asp:LinkButton>
                </FooterTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
     &nbsp;
     
     </div>
</ContentTemplate>
</asp:UpdatePanel>
    <br />
<asp:Image ID="imgAsc" runat="server" SkinID="ASC" Visible="false" />
<asp:Image ID="imgDesc" runat="server" SkinID="DESC" Visible="false" />
<script type="text/javascript">
SetUp();
var Message1 = "Thể loại đã xóa thì không thể khôi phục lại được, bạn có chắc chắn điều này? <br/><br/> Trường hợp, Nếu thể loại đã có bài viết thì hệ thống không cho phép xóa chúng.";
</script>
<asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
       <ProgressTemplate>
                <div class="overlay" id="divProgress" style="position: absolute">
                    <center>
                        <asp:Image runat="server" ID="AjaxLoading" SkinID="AjaxLoadingIndicator" />
                    </center>
                </div>
        </ProgressTemplate>
</asp:UpdateProgress>



